package com.base.demo.di

import com.base.demo.repository.DemoRemote
import com.base.demo.repository.DemoRepository
import com.base.demo.repository.LocalData
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.components.ViewModelComponent
import dagger.hilt.android.scopes.ViewModelScoped
import kotlin.coroutines.CoroutineContext

@Module
@InstallIn(ViewModelComponent::class)
class DemoRepositoryModule {

    @ViewModelScoped
    @Provides
    fun provideDemoRemoteData(io: CoroutineContext) = DemoRemote(io)



    @ViewModelScoped
    @Provides
    fun provideDemoLocalData() = LocalData()

    @ViewModelScoped
    @Provides
    fun provideDemoRepository(remoteData: DemoRemote, localData: LocalData) =
        DemoRepository(remoteData, localData)
}